 //页面初始化
    
 indexInit();
 function	indexInit(){
 	 
   
	    var httpHost = getHttpHost();
	    mui.plusReady(function(){
              wt = plus.nativeUI.showWaiting();
                $.post(httpHost+'/index/Base/index.html',{},function(d){
			da=JSON.parse(d);
			if(da.code==400){
				var l='';
				var data=da.data.banner;
				
				var url=da.data.url;

				l=' <div class="mui-slider-item mui-slider-item-duplicate"><a href="'+data[0]['link']+'"><img src="'+data[0]['image']+'"></a></div>';
				for(var i=0;i<data.length;i++){
						l+=' <div class="mui-slider-item"><a href="'+data[i]['link']+'"><img src="'+data[i]['image']+'"></a></div>';
				}
				l+='   <div class="mui-slider-item mui-slider-item-duplicate"><a href="'+data[data.length-1]['link']+'"><img src="'+data[data.length-1]['image']+'"></a></div>';
				$('#banner').html(l);
				$('#ke').attr('href',url[0]['url']);
				$('#gong').attr('href',url[1]['url']);
				$('#zhuan').attr('href',url[2]['url']);
				
			}
			          if(getToken()){
 		var token=getToken();
	    $.post(httpHost+'/index/Base/user.html',{token:token},function(d){
			
			window.localStorage.setItem('token',d);
	    })
 		$('#user-management').attr('href','user-management.html');
 		if(gethead()){
 			$('#userpic').attr('src',gethead());
 		}
 		if(getname()){
 			$('#user_name').html(getname());
 		}else{
 			$('#user_name').html('user_name');
 		}
 		$('#logout').show();
 		if(getvip()==1){
	 			var time=gettime() ;
	 			var html='过期时间：'+getLocalTime(time);
	 			$('#vip').html(html);
		}
	 
 		
 			
 		//注销
 		$('#logout').click(function(){
			window.localStorage.removeItem('token');
		    window.location.reload();
		}) 
		
           
        
//	    
		
 	}
			           wt.close(); 
	    })
      
            
        });
            
	  
 	
//	    
	
 }
 

